Conversation
d716b30 to
436435c
Compare
|
@mrbean-bremen Let me know what you think here. I’ve been testing this specific branch in the context of 3D Slicer/CommonTK and have had success. The CommonTK based CMake external project for building: Would Mevislab adopt CMake for PythonQt building at some point too? 3D Slicer and CommonTK has been a fully CMake build system for over a decade and Qt 6 switched to building with CMake as well. |
|
Thanks for this!
We actually use CMake to build PythonQt for a few years now, albeit our implementation may not be generic enough. As for the CI builds - I also think that in the long run we can remove the qmake jobs, at least for newer versions of Qt. |
That's great to hear as we will then have more people supporting the CMake build infrastructure here.
Yeah all the various jobs was definitely starting to get confusing to me because there were say Windows jobs from the build.yml workflow as well as build_latest.yml and I wasn't sure why both existed. Then the Windows CMake jobs just added more on top of that. Is there also still a need to support older Qt versions such as 5.9 and 5.11 in the latest |
From my perspective no (@he-hesce may disagree though 😀). |
|
We need support for Qt 5.9 which is in use on RHEL 7. However, as RHEL 7 is using Python 2.7, we are stuck on PythonQt 3.6.1 until RHEL 7 can be retired (~3-4 years). Then we can upgrade to PythonQt 4.x series. Qt 5.15 is what is used on RHEL 9 which means that in the 4.x series, we only need support for Qt 5.15. We would like that if possible that PythonQt kept qmake support in parallel with cmake support as we build PythonQt as part of our code base which uses Qt 5.15 and qmake which makes things nice and integrated without having to support/use another build system (cmake) from within qmake. I think it would be a good idea to support qmake as long as Qt 5.15 is supported. We can of course still get stuck on some specific 4.x revision eventually. It's likely we will be using Qt 5.15 for another 9 years at least as we need to support RHEL 9 until 2035 if not beyond the official EOL. We won't be moving to Qt 6.x (and thus cmake) until we move on to RHEL 10/11 and can drop support for RHEL 9/Qt 5.15 (so around 2035-2038). We prefer to use a single PythonQt version on all supported platforms as it makes building, testing, and deployment easier. Obviously I do understand that our needs cannot dictate overall PythonQt project policy and I appreciate the backward compatibility which exist so far. Our active support matrix for our scientific geophysical visualization software using PythonQt 3.6.1 on all platforms:
|
|
For @he-hesce's use case it seems like creating a |
|
@jamesobutler: Sounds good. I think for me, as PythonQt is "feature complete", a stable LTS branch would best be supported by ensuring newer Qt 6.x and Python 3.x releases are working (while not breaking older releases) as we don't know yet what Qt 6.x and Python 3.x will be the LTS-supported ones on RHEL 11 and Ubuntu 26.04 LTS and beyond. On RHEL 10, it appears they are currently supporting Qt 5.15/6.9 and Python 3.12 (thus making Qt 5.15 supported by RHEL until 31 May 2038 [!] and thus supported in our product until 2041). Thus backporting compatibility fixes from the main branch to LTS branches would be a good idea I think. Other than fixing critical/show-stopper bugs which are found (though these seem rare). |
Yes, with your help to support the backporting efforts to the LTS branch for your needs we can make this plan. |
|
For supporting an LTS branch, I think providing clean and separate commits for such changes on the main branch is the best approach, if feasible. This makes it easier to cherry-pick commits from the main branch for an LTS branch. E.g., not intermingle support for Python 3.15 with cmake build system in same commit. |
|
Yes, that is something we practice in all the repos related to 3D Slicer. MeVisLab devs can aim to commit to the same if they don't already. Then in the year 2041 or 2042, you can switch to the new branch that is Qt6 only and CMake build system only. Though at that point in time, who knows what type of dev tools we will have to support maintenance activities. This may not be something you have to worry about it since you are using the existing code pretty much without modifications for the next 16 years. |
|
I also think it would be a best practice approach to pick LTS distributions for basing support need on. Basically, keep in the testing matrix those Python and Qt versions which are provided by the LTS releases by Red Hat and let's say Ubuntu. Thus there would/should be no need unless requested to support other Qt and Python 3 versions than those which are long-term-supported by the platform vendor themselves. I.e., a PythonQt LTS branch should build and pass test suites on RHEL and Ubuntu LTS platforms in active vendor support window. E.g., there should be no need to support Python 3.x versions on RHEL 10 which are not supported by RH themselves on RHEL 10. |
|
@jamesobutler: I expect to be retired by 2041 :-) but I do need to keep the 40-80 year lifespan of the software under consideration for future generations of developers. The move-fast-and-break-things crew underestimate the lifespan and support window of scientific/production-use software. (We are still using and supporting scientific libraries from the 70s/80s as the science has not changed and thus the library does not need to be rewritten potentially introducing new errors.) |
|
Yes, for us we are trying to solve "today's problems today" so staying on latest tooling, libraries (e.g. Qt6), operating systems (Win11, macOS 26, etc) are critical and expected of our customers in the scientific and medical imaging space. We can keep an LTS, but it appears our group and MeVisLab will aim to solve development issues we run into in the near term. |
|
@jamesobutler: Good you have customers which upgrade. I have seen MRI machines still running Windows 2000 this year. :-) |
|
Yes, we have customers with CT, Ultrasound and Optical imaging instruments switching from Windows 10 to Windows 11 based on Windows 10 no longer receiving security updates and otherwise not allowed for use at their institution. |
|
We have software which would take 20-30 years to rewrite thus it will never be funded, happen, or even work out as imagine a 30-year project being successful. Thus it is patching and supporting old software and systems to keep going forever which is the way. Security is less of an issue as nothing is exposed directly to the Internet and RH does still provide security support for RHEL 7. Managed to get all systems off RHEL 6 about two years ago and get them moved to RHEL 7. Those systems might be ported and able to be moved to RHEL 9 in about 3-4 years but that may be too optimistic. Tendency is to be able to move to a new platform when that platform is already approaching EOL. (It takes about 5-10 years to do the porting, testing, and acceptance.) Luckily we do not need to support Windows nor macOS with their brief support windows. We shifted from Solaris to Linux 20 years ago; and from VMS to Solaris some decades before that. Still using scientific libraries originally written for VMS in Fortran 77. Moving some (20%, thus not yet all) scientific visualization from Motif to Qt took 15 years. Though the lion share of visualization still running on Motif and will continue to do so for a decade or longer. A major issue being RHEL 10 dropping Motif support so RHEL 9 might be in use for a very long time (beyond EOL). The benefit of moving from Motif to Qt and thanks to PythonQt, embedded scripting (extensions) could move from a bespoke scripting language to Python. Python then also enabling extensions and interchange of data with Obspy and the Python scientific code community. (Young, <50yo) Scientists also do/know more Python these days than C/C++ for writing extensions. |
We can always create a maintenance branch from a tag, as soon as the need arrives to back-port something. From my experience, this is rarely needed for small projects like this one, and we can decide how to do it when needed. Declaring an official LTS may be overkill given the size of the user base.
Up to a point. As we have ditched Python 2 support, we will probably not support some older Python and Qt versions in the future - that depends on the kind of changes needed for newer versions. Planning ahead 10 years is generally way to ambitious for me for any project (especially small ones) 😀
Yes, I think this is our common approach here.
Exactly.
I can readily believe this. I was involved in making a patch release for software running under Windows 2000 a few years ago - in a VM with W2K, 4GB HD and 64MB RAM, that was really fun... I have also seen crashed ATMs showing the Windows NT 4 panic screen not so long ago. |
usiems
left a comment
There was a problem hiding this comment.
Also please combine the commits as much as useful. The history of these changes is not that interesting for other users, the only reason to have separate commits is if one might perhaps want to merge or revert only parts of this change.
| Multimedia | ||
| UiTools | ||
| Xml | ||
| ) |
There was a problem hiding this comment.
It seems to me that WebEngineWidgets is missing from this list.
There was a problem hiding this comment.
Do not compile the Qt bindings into PythonQt, make it a separate library, same as with the QMake build system. And use separate CMakeLists.txt files. Probably best to put it into src for PythonQt itself, and into extensions for the bindings similar to qmake (since generated_cpp is only created on-the-fly, but I'm open to other suggestions), and use add_subdirectory in the top-level CMakeLists.txt. Perhaps call the bindings project PythonQt_QtAll for now.
In MeVisLab the Qt bindings are dynamically loaded through Python imports, with each module having its own DLL/.so file, so we want to build those separately anyway. It would be easier for us to merge this part back if the bindings are built on their own anyway.
…mmontk/PythonQt fork This commit brings in CMake support from historical changes developed in the `commontk/PythonQt` fork between 2011 and 2026. Co-authored-by: Florian Link <5535644+florianlink@users.noreply.github.com> Co-authored-by: Matthew Woehlke <matthew.woehlke@kitware.com> Co-authored-by: Max Smolens <max.smolens@kitware.com> Co-authored-by: Pat Marion <james.patrick.marion@gmail.com> Co-authored-by: Francois Budin <francois.budin@kitware.com> Co-authored-by: Christoph Willing <chris.willing@linux.com> Co-authored-by: Stefan Dinkelacker <s.dinkelacker@dkfz-heidelberg.de> Co-authored-by: Sylvain Bernhardt <sylvain.bernhardt@smith-nephew.com>
There are 3 different yml files providing a matrix of testing. This commit aims to make it easier to scan all the jobs to see what is the same and different between each. Co-authored-by: Copilot <copilot@github.com>
e87f579 to
f4164d7
Compare
This PR is an effort previously discussed to bring in the CMake build system for modern cross compilation of C++ libraries. This PR includes the CMake build system as of https://github.com/commontk/PythonQt/tree/patched-v4.0.1-2026-03-16-5cd9b581f. The CommonTK organization is used by applications such as 3D Slicer and MITK. Using CMake to build PythonQt has been utilized successfully by 3D Slicer for well over a decade. Integration of this work back to the upstream has taken a long time due to multiple factors including MeVisLab's PythonQt source repository not on GitHub and 3D Slicer maintaining a series of patches that had not been contributed back to the upstream. Both situations have changed where PythonQt is on GitHub and the long list of patches were contributed to the upstream in the fall of 2025.
A large majority of this CMake work is due to the fantastic work by @jcfr who also worked to contribute the patches back to this upstream repo. Late last year JC made a job move to Nvidia and therefore contributions to 3D Slicer and the ecosystem of supporting open-source libraries has been limited. I submit this PR to keep this work going to bring the CommonTK fork of PythonQt back in sync with the MeVisLab PythonQt upstream.
I provide all the commits here for the CMake development for historic reference, but maintainers could consider squashing of commits for less noise.
I have created a new GitHub actions workflow as part of testing the CMake build system similar to the existing CI infrastructure. This PR doesn't currently remove the existing build system, though maintainers here could consider a replacement based on stabilization here and then avoid the complexity of maintaining 2 build systems.